package com.aidong.login.biz.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.aidong.login.biz.MemberIntegralLogBiz;
import com.aidong.login.dao.MemberIntegralLogDao;
import com.aidong.login.entity.MemberIntegralLog;

@Service("memberIntegralLogBiz")
public class MemberIntegralLogBizImpl implements MemberIntegralLogBiz {

	private MemberIntegralLogDao memberIntegralLogDao;

	@Autowired
	public void setMemberIntegralLogDao(MemberIntegralLogDao memberIntegralLogDao) {
		this.memberIntegralLogDao = memberIntegralLogDao;
	}

	@Override
	public List<MemberIntegralLog> getLogs(int idongId) {
		return memberIntegralLogDao.getIntegralLog(idongId, -1);
	}

	@Override
	public void addLog(MemberIntegralLog log) {
		memberIntegralLogDao.addIntegralLog(log);
	}

	@Override
	public List<MemberIntegralLog> getLogs(int idongId, int page) {
		return memberIntegralLogDao.getIntegralLog(idongId, (page - 1) * 25);
	}

	@Override
	public List<MemberIntegralLog> getUnconfirmIntegral() {
		return memberIntegralLogDao.getUnconfirmIntegral();
	}

	@Override
	public void confirmIntegral(MemberIntegralLog log) {
		memberIntegralLogDao.confirmIntegral(log);
	}

	@Override
	public void confirmIntegrals(List<Integer> ids) {
		memberIntegralLogDao.confirmIntegrals(ids);
	}
}
